<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OptionsPricing: TimeStepper.py Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OptionsPricing
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="dir_10671ff18db44d298e3037435735ff34.html">solvers</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">TimeStepper.py</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">#!/usr/bin/python</span>
<a name="l00002"></a>00002 <span class="comment"># -*- coding: utf-8 -*-</span>
<a name="l00003"></a>00003 
<a name="l00004"></a>00004 <span class="comment"># Copyright (c) 2011</span>
<a name="l00005"></a>00005 <span class="comment">#</span>
<a name="l00006"></a>00006 <span class="comment"># Permission is hereby granted, free of charge, to any person obtaining a</span>
<a name="l00007"></a>00007 <span class="comment"># copy of this software and associated documentation files (the &quot;Software&quot;),</span>
<a name="l00008"></a>00008 <span class="comment"># to deal in the Software without restriction, including without limitation</span>
<a name="l00009"></a>00009 <span class="comment"># the rights to use, copy, modify, merge, publish, distribute, sublicense,</span>
<a name="l00010"></a>00010 <span class="comment"># and/or sell copies of the Software, and to permit persons to whom the</span>
<a name="l00011"></a>00011 <span class="comment"># Software is furnished to do so, subject to the following conditions:</span>
<a name="l00012"></a>00012 <span class="comment">#</span>
<a name="l00013"></a>00013 <span class="comment"># The above copyright notice and this permission notice shall be included in</span>
<a name="l00014"></a>00014 <span class="comment"># all copies or substantial portions of the Software.</span>
<a name="l00015"></a>00015 <span class="comment">#</span>
<a name="l00016"></a>00016 <span class="comment"># THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<a name="l00017"></a>00017 <span class="comment"># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<a name="l00018"></a>00018 <span class="comment"># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<a name="l00019"></a>00019 <span class="comment"># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<a name="l00020"></a>00020 <span class="comment"># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<a name="l00021"></a>00021 <span class="comment"># OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
<a name="l00022"></a>00022 <span class="comment"># SOFTWARE.</span>
<a name="l00023"></a>00023 <span class="comment">#</span>
<a name="l00024"></a>00024 <span class="comment"># Author: Jesus Carrero &lt;j.o.carrero@gmail.com&gt;</span>
<a name="l00025"></a>00025 <span class="comment"># Mountain View, CA</span>
<a name="l00026"></a>00026 <span class="comment">#</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 __docformat__ = <span class="stringliteral">&#39;restructuredtext&#39;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="keyword">from</span> TimeStepperBase <span class="keyword">import</span> TimeStepperBase
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 
<a name="l00033"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html">00033</a> <span class="keyword">class </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html">TimeStepper</a>(TimeStepperBase):
<a name="l00034"></a>00034 
<a name="l00035"></a>00035     <span class="stringliteral">&quot;&quot;&quot;</span>
<a name="l00036"></a>00036 <span class="stringliteral">        m_mat_struct ~ 3, 5 diag or something else.</span>
<a name="l00037"></a>00037 <span class="stringliteral">        m_mfwd ~ matrix to fwd step</span>
<a name="l00038"></a>00038 <span class="stringliteral">        m_mbwd ~ matrix to bwd step</span>
<a name="l00039"></a>00039 <span class="stringliteral">    &quot;&quot;&quot;</span>
<a name="l00040"></a>00040 
<a name="l00041"></a>00041     __slots__ = [
<a name="l00042"></a>00042         <span class="stringliteral">&#39;m_keep_hist&#39;</span>,
<a name="l00043"></a>00043         <span class="stringliteral">&#39;m_theta&#39;</span>,
<a name="l00044"></a>00044         <span class="stringliteral">&#39;m_mat_struct&#39;</span>,
<a name="l00045"></a>00045         <span class="stringliteral">&#39;m_massat_bound&#39;</span>,
<a name="l00046"></a>00046         <span class="stringliteral">&#39;m_method&#39;</span>,
<a name="l00047"></a>00047         <span class="stringliteral">&#39;m_mfwd&#39;</span>,
<a name="l00048"></a>00048         <span class="stringliteral">&#39;m_mbwd&#39;</span>,
<a name="l00049"></a>00049         <span class="stringliteral">&#39;m_mdiags&#39;</span>,
<a name="l00050"></a>00050         <span class="stringliteral">&#39;m_nstps&#39;</span>,
<a name="l00051"></a>00051         <span class="stringliteral">&#39;m_lfbd&#39;</span>,
<a name="l00052"></a>00052         <span class="stringliteral">&#39;m_log_info&#39;</span>,
<a name="l00053"></a>00053         <span class="stringliteral">&#39;m_ribd&#39;</span>,
<a name="l00054"></a>00054         <span class="stringliteral">&#39;m_stiffat_bound&#39;</span>,
<a name="l00055"></a>00055         <span class="stringliteral">&#39;m_sdiags&#39;</span>,
<a name="l00056"></a>00056         <span class="stringliteral">&#39;m_diag_posi&#39;</span>,
<a name="l00057"></a>00057         <span class="stringliteral">&#39;m_str_time&#39;</span>,
<a name="l00058"></a>00058         <span class="stringliteral">&#39;m_stp_time&#39;</span>,
<a name="l00059"></a>00059         <span class="stringliteral">&#39;m_init_state&#39;</span>,
<a name="l00060"></a>00060         <span class="stringliteral">&#39;m_xl&#39;</span>,
<a name="l00061"></a>00061         <span class="stringliteral">&#39;m_xr&#39;</span>,
<a name="l00062"></a>00062         ]
<a name="l00063"></a>00063 
<a name="l00064"></a>00064     methods = {
<a name="l00065"></a>00065         <span class="stringliteral">&#39;cn&#39;</span>: <span class="stringliteral">&#39;cranck - nicolson&#39;</span>,
<a name="l00066"></a>00066         <span class="stringliteral">&#39;ra&#39;</span>: <span class="stringliteral">&#39;rannacher&#39;</span>,
<a name="l00067"></a>00067         <span class="stringliteral">&#39;ee&#39;</span>: <span class="stringliteral">&#39;euler explicit&#39;</span>,
<a name="l00068"></a>00068         <span class="stringliteral">&#39;ei&#39;</span>: <span class="stringliteral">&#39;euler - implicit&#39;</span>,
<a name="l00069"></a>00069         <span class="stringliteral">&#39;te&#39;</span>: <span class="stringliteral">&#39;theta&#39;</span>,
<a name="l00070"></a>00070         }
<a name="l00071"></a>00071 
<a name="l00072"></a>00072     <span class="keyword">def </span>__init__(self, method):
<a name="l00073"></a>00073         TimeStepperBase.__init__(self)
<a name="l00074"></a>00074 
<a name="l00075"></a>00075         (self.m_xl, self.m_xr) = (<span class="keywordtype">None</span>, <span class="keywordtype">None</span>)
<a name="l00076"></a>00076         (self.m_str_time, self.m_stp_time, self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ab2b6900187e3ec448869680483664d7b">m_nstps</a>) = (<span class="keywordtype">None</span>, <span class="keywordtype">None</span>,
<a name="l00077"></a>00077                 <span class="keywordtype">None</span>)
<a name="l00078"></a>00078         (self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aa544424b0073fe261789b85c161b695f">m_keep_hist</a>, self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ad837ee95c2ad40445db49ce3b8f98a15">m_log_info</a>) = (<span class="keyword">False</span>, <span class="keyword">False</span>)
<a name="l00079"></a>00079         (self.m_mfwd, self.m_mbwd) = (<span class="keywordtype">None</span>, <span class="keywordtype">None</span>)
<a name="l00080"></a>00080         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aa1479b8f4e534e3765bf572ba4280560">m_mat_struct</a> = <span class="keywordtype">None</span>
<a name="l00081"></a>00081         (self.m_mdiags, self.m_sdiags, self.m_diag_posi) = (<span class="keywordtype">None</span>, <span class="keywordtype">None</span>,
<a name="l00082"></a>00082                 <span class="keywordtype">None</span>)
<a name="l00083"></a>00083         (self.m_lfbd, self.m_ribd) = (<span class="keywordtype">None</span>, <span class="keywordtype">None</span>)
<a name="l00084"></a>00084 
<a name="l00085"></a>00085         (self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ab2329adb7bff70f9ebf93ced8f8b4b5e">m_init_state</a>, self.m_massat_bound) = (<span class="keywordtype">None</span>, <span class="keywordtype">None</span>)
<a name="l00086"></a>00086         (self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a6cbc3ea7fef6e4094e249405b746e26e">m_method</a>, self.m_stiffat_bound, self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ae7fcfc8aa1af44b04f1c0f6bb42d1926">m_theta</a>) = (<span class="keywordtype">None</span>,
<a name="l00087"></a>00087                 <span class="keywordtype">None</span>, <span class="keywordtype">None</span>)
<a name="l00088"></a>00088 
<a name="l00089"></a>00089         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a319e9b79c724359fb48853c211c0c73a">set_time_step_method</a>(method)
<a name="l00090"></a>00090 
<a name="l00091"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a7461d6aa7074ed4910c971692f9fb583">00091</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a7461d6aa7074ed4910c971692f9fb583">set_time2simulate</a>(self, stp_time, start=0):
<a name="l00092"></a>00092         <span class="stringliteral">&quot;&quot;&quot; set final and start time. &quot;&quot;&quot;</span>
<a name="l00093"></a>00093 
<a name="l00094"></a>00094         (self.m_stp_time, self.m_str_time) = (stp_time, start)
<a name="l00095"></a>00095 
<a name="l00096"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a20a7f306aa8343a4c96b76c043c515f5">00096</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a20a7f306aa8343a4c96b76c043c515f5">set_number_steps</a>(self, nstps):
<a name="l00097"></a>00097         <span class="stringliteral">&quot;&quot;&quot; number of time steps. &quot;&quot;&quot;</span>
<a name="l00098"></a>00098 
<a name="l00099"></a>00099         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ab2b6900187e3ec448869680483664d7b">m_nstps</a> = nstps
<a name="l00100"></a>00100 
<a name="l00101"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a319e9b79c724359fb48853c211c0c73a">00101</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a319e9b79c724359fb48853c211c0c73a">set_time_step_method</a>(self, method):
<a name="l00102"></a>00102         <span class="stringliteral">&quot;&quot;&quot; Implicit, Explicit, Cranck-Nicolson. &quot;&quot;&quot;</span>
<a name="l00103"></a>00103 
<a name="l00104"></a>00104         <span class="keyword">assert</span> method <span class="keywordflow">in</span> self.methods.keys()
<a name="l00105"></a>00105         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ae7fcfc8aa1af44b04f1c0f6bb42d1926">m_theta</a> = {<span class="stringliteral">&#39;cn&#39;</span> : 0.5,
<a name="l00106"></a>00106          <span class="stringliteral">&#39;ra&#39;</span> : 0.5, <span class="comment"># to be implemented</span>
<a name="l00107"></a>00107          <span class="stringliteral">&#39;ei&#39;</span> : 0.0,
<a name="l00108"></a>00108          <span class="stringliteral">&#39;ee&#39;</span> : 1.0, <span class="comment"># Never converge :)</span>
<a name="l00109"></a>00109          <span class="stringliteral">&#39;te&#39;</span> : 1.0,
<a name="l00110"></a>00110          }[method]
<a name="l00111"></a>00111 
<a name="l00112"></a>00112         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a6cbc3ea7fef6e4094e249405b746e26e">m_method</a> = method
<a name="l00113"></a>00113 
<a name="l00114"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a9212240ab66c6a9d2ceb4e791de9b243">00114</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a9212240ab66c6a9d2ceb4e791de9b243">set_xlxr</a>(self, xmin, xmax):
<a name="l00115"></a>00115         <span class="stringliteral">&quot;&quot;&quot; spatial grid boundary. &quot;&quot;&quot;</span>
<a name="l00116"></a>00116 
<a name="l00117"></a>00117         (self.m_xl, self.m_xr) = (xmin, xmax)
<a name="l00118"></a>00118 
<a name="l00119"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aef2ac56ffcfcbe740936f460b95d679d">00119</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aef2ac56ffcfcbe740936f460b95d679d">get_start_time</a>(self):
<a name="l00120"></a>00120         <span class="stringliteral">&quot;&quot;&quot; when to start time stepping. &quot;&quot;&quot;</span>
<a name="l00121"></a>00121 
<a name="l00122"></a>00122         <span class="keywordflow">return</span> self.m_str_time
<a name="l00123"></a>00123 
<a name="l00124"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aaa4fe1c88e3b5d41948db1b03feda6ab">00124</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aaa4fe1c88e3b5d41948db1b03feda6ab">get_expiry</a>(self):
<a name="l00125"></a>00125         <span class="stringliteral">&quot;&quot;&quot; stopping time. &quot;&quot;&quot;</span>
<a name="l00126"></a>00126 
<a name="l00127"></a>00127         <span class="keywordflow">return</span> self.m_stp_time
<a name="l00128"></a>00128 
<a name="l00129"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ac13f18fc4fcb51d4cfbc2daaf4c48d56">00129</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ac13f18fc4fcb51d4cfbc2daaf4c48d56">get_left_right</a>(self):
<a name="l00130"></a>00130         <span class="stringliteral">&quot;&quot;&quot; return boundary condtions at each time step. &quot;&quot;&quot;</span>
<a name="l00131"></a>00131 
<a name="l00132"></a>00132         <span class="keywordflow">return</span> (self.m_xl, self.m_xr)
<a name="l00133"></a>00133 
<a name="l00134"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#adad61e426ffaf09bf2c53ac1d8e358b9">00134</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#adad61e426ffaf09bf2c53ac1d8e358b9">set_dolog</a>(self, log_info):
<a name="l00135"></a>00135         <span class="stringliteral">&quot;&quot;&quot; logger class. &quot;&quot;&quot;</span>
<a name="l00136"></a>00136 
<a name="l00137"></a>00137         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ad837ee95c2ad40445db49ce3b8f98a15">m_log_info</a> = log_info
<a name="l00138"></a>00138 
<a name="l00139"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a0c3b880aa9a576226f6482a8facbcb10">00139</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a0c3b880aa9a576226f6482a8facbcb10">set_keep_hist</a>(self, keep_hist):
<a name="l00140"></a>00140         <span class="stringliteral">&quot;&quot;&quot; keep solution at each time step. &quot;&quot;&quot;</span>
<a name="l00141"></a>00141 
<a name="l00142"></a>00142         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aa544424b0073fe261789b85c161b695f">m_keep_hist</a> = keep_hist
<a name="l00143"></a>00143 
<a name="l00144"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a685d39dd562f42bc91944624a145e573">00144</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a685d39dd562f42bc91944624a145e573">get_nsteps</a>(self):
<a name="l00145"></a>00145         <span class="stringliteral">&quot;&quot;&quot; number of steps. &quot;&quot;&quot;</span>
<a name="l00146"></a>00146 
<a name="l00147"></a>00147         <span class="keywordflow">return</span> self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ab2b6900187e3ec448869680483664d7b">m_nstps</a>
<a name="l00148"></a>00148 
<a name="l00149"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aabc043e3af7c3c1007fdec94dec60e7a">00149</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aabc043e3af7c3c1007fdec94dec60e7a">time_stepper_log</a>(self):
<a name="l00150"></a>00150         <span class="stringliteral">&quot;&quot;&quot; log generated during time stepping. &quot;&quot;&quot;</span>
<a name="l00151"></a>00151 
<a name="l00152"></a>00152         <span class="keywordflow">return</span> self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ad837ee95c2ad40445db49ce3b8f98a15">m_log_info</a>
<a name="l00153"></a>00153 
<a name="l00154"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a873a059f6dbbc62025a350d2d87c66ad">00154</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a873a059f6dbbc62025a350d2d87c66ad">keep_history</a>(self):
<a name="l00155"></a>00155         <span class="stringliteral">&quot;&quot;&quot; did we keep the solutions at each time step. &quot;&quot;&quot;</span>
<a name="l00156"></a>00156 
<a name="l00157"></a>00157         <span class="keywordflow">return</span> self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aa544424b0073fe261789b85c161b695f">m_keep_hist</a>
<a name="l00158"></a>00158 
<a name="l00159"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a160c92aa0648d41224fcfc6dc7a2831f">00159</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a160c92aa0648d41224fcfc6dc7a2831f">get_methods</a>(self):
<a name="l00160"></a>00160         <span class="stringliteral">&quot;&quot;&quot; Implicit, Eplicit, Cranck-Nicolson. &quot;&quot;&quot;</span>
<a name="l00161"></a>00161 
<a name="l00162"></a>00162         <span class="keywordflow">return</span> [self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a9203cee3b80c1d8f5de369ace6a4ad85">methods</a>[key] <span class="keywordflow">for</span> key <span class="keywordflow">in</span> self.methods.keys()]
<a name="l00163"></a>00163 
<a name="l00164"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a21d68af16889f1d717e9843bcfdf53f2">00164</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a21d68af16889f1d717e9843bcfdf53f2">set_mat_attrib</a>(self, struct):
<a name="l00165"></a>00165         <span class="stringliteral">&quot;&quot;&quot; Pentadiagonal, Tridiagonal, ... &quot;&quot;&quot;</span>
<a name="l00166"></a>00166 
<a name="l00167"></a>00167         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aa1479b8f4e534e3765bf572ba4280560">m_mat_struct</a> = struct
<a name="l00168"></a>00168 
<a name="l00169"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aeb69672d5d94de49bbfe132c8c4f7ba7">00169</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aeb69672d5d94de49bbfe132c8c4f7ba7">get_mat_structure</a>(self):
<a name="l00170"></a>00170         <span class="stringliteral">&quot;&quot;&quot; Pentadiagonal, Tridiagonal, ... &quot;&quot;&quot;</span>
<a name="l00171"></a>00171 
<a name="l00172"></a>00172         <span class="keywordflow">return</span> self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aa1479b8f4e534e3765bf572ba4280560">m_mat_struct</a>
<a name="l00173"></a>00173 
<a name="l00174"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ac3aac45c207a9fef3fec5562f70ad556">00174</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ac3aac45c207a9fef3fec5562f70ad556">get_mass_matrix</a>(self):
<a name="l00175"></a>00175         <span class="stringliteral">&quot;&quot;&quot; mass matrix. &quot;&quot;&quot;</span>
<a name="l00176"></a>00176 
<a name="l00177"></a>00177         <span class="keywordflow">return</span> self.m_mdiags
<a name="l00178"></a>00178 
<a name="l00179"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a207b49f287dc41bdbe069708324de236">00179</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a207b49f287dc41bdbe069708324de236">get_diag_posi</a>(self):
<a name="l00180"></a>00180         <span class="stringliteral">&quot;&quot;&quot; where to place diagonals in global matrix. &quot;&quot;&quot;</span>
<a name="l00181"></a>00181 
<a name="l00182"></a>00182         <span class="keywordflow">return</span> self.m_diag_posi
<a name="l00183"></a>00183 
<a name="l00184"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ad169c4a4a8c4e439c8127574da961e4d">00184</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ad169c4a4a8c4e439c8127574da961e4d">get_stiffness_matrix</a>(self):
<a name="l00185"></a>00185         <span class="stringliteral">&quot;&quot;&quot; stiffness matrix. &quot;&quot;&quot;</span>
<a name="l00186"></a>00186 
<a name="l00187"></a>00187         <span class="keywordflow">return</span> self.m_sdiags
<a name="l00188"></a>00188 
<a name="l00189"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a5fd9651043ece072d2385fe230ac6c9a">00189</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a5fd9651043ece072d2385fe230ac6c9a">set_moperators</a>(self, mdatas, sdatas, diags):
<a name="l00190"></a>00190         <span class="stringliteral">&quot;&quot;&quot; matrices in diagoal format. &quot;&quot;&quot;</span>
<a name="l00191"></a>00191 
<a name="l00192"></a>00192         (self.m_mdiags, self.m_sdiags, self.m_diag_posi) = (mdatas,
<a name="l00193"></a>00193                 sdatas, diags)
<a name="l00194"></a>00194 
<a name="l00195"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a0a7b4acbb10f99362de9a76e087cee84">00195</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a0a7b4acbb10f99362de9a76e087cee84">set_bcond</a>(self, lfbd, ribd):
<a name="l00196"></a>00196         <span class="stringliteral">&quot;&quot;&quot; boundary conditions. &quot;&quot;&quot;</span>
<a name="l00197"></a>00197 
<a name="l00198"></a>00198         (self.m_lfbd, self.m_ribd) = (lfbd, ribd)
<a name="l00199"></a>00199 
<a name="l00200"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a211eb05a0a811b7630df4e85c253e805">00200</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a211eb05a0a811b7630df4e85c253e805">set_boperators</a>(self, massat_bound, stiffat_bound):
<a name="l00201"></a>00201         <span class="stringliteral">&quot;&quot;&quot; mass and stiffness matrix at the boundary. &quot;&quot;&quot;</span>
<a name="l00202"></a>00202 
<a name="l00203"></a>00203         (self.m_massat_bound, self.m_stiffat_bound) = (massat_bound,
<a name="l00204"></a>00204                 stiffat_bound)
<a name="l00205"></a>00205 
<a name="l00206"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a273604d4f4fd8f445d2fa9ffd0200ab5">00206</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a273604d4f4fd8f445d2fa9ffd0200ab5">get_mass_stiff_at_bd</a>(self):
<a name="l00207"></a>00207         <span class="stringliteral">&quot;&quot;&quot; mass and stiffness matrix at the boundary. &quot;&quot;&quot;</span>
<a name="l00208"></a>00208 
<a name="l00209"></a>00209         <span class="keywordflow">return</span> (self.m_massat_bound, self.m_stiffat_bound)
<a name="l00210"></a>00210 
<a name="l00211"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a92c44be9edcb8ebbbf0fba750435559b">00211</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a92c44be9edcb8ebbbf0fba750435559b">set_ival</a>(self, init_state):
<a name="l00212"></a>00212         <span class="stringliteral">&quot;&quot;&quot; solution at time 0. &quot;&quot;&quot;</span>
<a name="l00213"></a>00213 
<a name="l00214"></a>00214         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ab2329adb7bff70f9ebf93ced8f8b4b5e">m_init_state</a> = init_state
<a name="l00215"></a>00215 
<a name="l00216"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#abefa1b7ca4965b8ea257192409e10b17">00216</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#abefa1b7ca4965b8ea257192409e10b17">get_initial_state</a>(self):
<a name="l00217"></a>00217         <span class="stringliteral">&quot;&quot;&quot; solution at time 0 &quot;&quot;&quot;</span>
<a name="l00218"></a>00218 
<a name="l00219"></a>00219         <span class="keywordflow">return</span> self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ab2329adb7bff70f9ebf93ced8f8b4b5e">m_init_state</a>
<a name="l00220"></a>00220 
<a name="l00221"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a653bd7b577a4b808a9879fac18b681e9">00221</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a653bd7b577a4b808a9879fac18b681e9">eval_left_bc</a>(self, xleft, dtime):
<a name="l00222"></a>00222         <span class="stringliteral">&quot;&quot;&quot; vector with bc at each time step. &quot;&quot;&quot;</span>
<a name="l00223"></a>00223 
<a name="l00224"></a>00224         <span class="keywordflow">return</span> self.m_lfbd(xleft, dtime)
<a name="l00225"></a>00225 
<a name="l00226"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a7f83d7f27cb1b5afdb1aee4c82cbc270">00226</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#a7f83d7f27cb1b5afdb1aee4c82cbc270">eval_right_bd_cond</a>(self, xleft, dtime):
<a name="l00227"></a>00227         <span class="stringliteral">&quot;&quot;&quot; vector with bc at each time step. &quot;&quot;&quot;</span>
<a name="l00228"></a>00228 
<a name="l00229"></a>00229         <span class="keywordflow">return</span> self.m_ribd(xleft, dtime)
<a name="l00230"></a>00230 
<a name="l00231"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ac49e3795fe4addd3bbac07de0e400d81">00231</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ac49e3795fe4addd3bbac07de0e400d81">get_history</a>(self):
<a name="l00232"></a>00232         <span class="stringliteral">&quot;&quot;&quot; virtual method. &quot;&quot;&quot;</span>
<a name="l00233"></a>00233 
<a name="l00234"></a>00234         <span class="keywordflow">raise</span> Warning(<span class="stringliteral">&#39;This is a base class of a virtual method&#39;</span>)
<a name="l00235"></a>00235 
<a name="l00236"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aa1e04c73b5914f03e638d20ad94acdd5">00236</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#aa1e04c73b5914f03e638d20ad94acdd5">get_theta</a>(self):
<a name="l00237"></a>00237         <span class="stringliteral">&quot;&quot;&quot; \theat step method. &quot;&quot;&quot;</span>
<a name="l00238"></a>00238 
<a name="l00239"></a>00239         <span class="keywordflow">return</span> self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ae7fcfc8aa1af44b04f1c0f6bb42d1926">m_theta</a>
<a name="l00240"></a>00240 
<a name="l00241"></a><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ae2ae5ea3687e6931ecd1f201dc56646f">00241</a>     <span class="keyword">def </span><a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ae2ae5ea3687e6931ecd1f201dc56646f">set_theta</a>(self, theta):
<a name="l00242"></a>00242         <span class="stringliteral">&quot;&quot;&quot; \theat step method. &quot;&quot;&quot;</span>
<a name="l00243"></a>00243 
<a name="l00244"></a>00244         self.<a class="code" href="classsolvers_1_1TimeStepper_1_1TimeStepper.html#ae7fcfc8aa1af44b04f1c0f6bb42d1926">m_theta</a> = theta
<a name="l00245"></a>00245 
<a name="l00246"></a>00246 
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Thu Dec 22 2011 05:17:53 for OptionsPricing by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
